First of all, build your door: one (or more) brushes for the door itself and another brush for the origin brush:
The door may consist of more than one brush (e.g. to add a window to it), but for now, we make the door just out of 1 brush:
Now, we add a origin brush. This will tell the engine where the axis of the door is, and it will be exactly in the center of that origin brush. Make a brush overlapping the door at the hinge's side. It is easier to select later, if u made it thicker than the door. Texture this brush with common/origin:
These are the pieces our door will be made of. Now select all brushes of the door (in this case just one) and additionally the origin brush.
All brushes selected? Great! Now rightclick in any 2D-view on one of the (still selected) brushes. This will open a list of all available entities. Choose func/rotatingdoor
You have made a rotating door!
Unfortunately you will have to tell the engine, how this rotating door shall behave ingame. To do so, you will have to set some keys and their values. For this, your door - or atleast one brush of it - must be selected. If it isn't already, select one brush of the door, and press 'n'.
This will open the entity inspector
Here you can enter the keys and their values the rotating door is needing to work properly.
Most important is the key 'angle' and its correct value. Take a look at the table below to see which door will get which value. In general the angle must be set perpendicular to the door face.
Special doors need special key/value pairs. They are listed in the lower part of the table.
Please note: You will not be able to make the door swing up or down, just to the side. Many tried but invain. You will have to use a script_object for this!
| Pictures of the door in the xy top view | key | value |
|---|---|---|
or ![]() | angle | 90 or 270 (doesn't matter) |
or ![]() | angle | 0 or 180 (doesn't matter) |
or ![]() | angle | 135 or 315 (doesn't matter) |
or ![]() | angle | 45 or 225 (doesn't matter) |
| Settingthe door's sound | ||
|---|---|---|
| doortype | key | value |
| wooden door | doortype | wood |
| metal door | doortype | metal |
| Misc keys and values | |
|---|---|
| health | if set, door must be shot open |
| dmg | damage to inflict when blocked (0 default) |
| time | movement time(0.3 default) |
| wait | wait before returning (3 default, -1 = never return) |
| openangle | how wide the door will open(90 default) |
Why must the origin brush not overlap with the adjacent walls? I'm sure I've had no trouble when my origin brush has overlapped with adjacent walls. In fact, I believe the origin brush should most certainly overlap with the adjacent walls in order for the door to open like a real door. As opposed to the image shown here, I believe the center of the origin brush should touch both the edge of the door and the edge of the wall, like a real hinge does, rather than lying inside the door as shown here. That way the door will act more like a door in your house - one corner of it will always be touching (or very close to it) the door frame, as opposed to the example given here which would more closely match a door that had holes in the floor and door frame above and below it with an axle about which the door rotated, like you might see with glass doors. I might be wrong here, but I'm pretty sure this works, although I don't know much about the architecture of the time :)
- dcoshea
You are correct. No problem putting the origin anywhere you want... even completely inside the wall works fine. If you want it to rotate around a point inside the wall, no problem. The origin only decides around what x/y coordinate the door will rotate ( z value is not used ).
- Bjarne